package top.psjj.news.utils;

/**
 * @Auther:小陈的Java
 */
public class StepUtils {
    public static int[] steps(int currentPage,int pageNum,int step){
        if (step>=pageNum){
            return new int[]{1,pageNum};
        }else if(currentPage<=step/2){
            return new int[]{1,step};
        }else if (currentPage>pageNum-step/2){
            return new int[]{pageNum-step+1,pageNum};
        }else {
            int begin = currentPage-step/2;
            int end = currentPage+step/2;
            return new int[]{begin,end};
        }
    }
}
